package com.tutu.user.controller;


import com.tutu.commons.entity.User;
import com.tutu.user.service.UserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Program: SpringCloud
 * @Description:
 * @Author: JK.TuTu
 * @ @Version: 1.0
 * @Create: 2022-12-01 12:47
 **/
@RestController
@RequestMapping("/user")
public class UserController {

    @Resource
    UserService service;

    //这里以RESTFul风格为例
    @GetMapping("/{uid}")
    public User findUserById(@PathVariable("uid") int uid){
        return service.getUserById(uid);
    }
}
